<!DOCTYPE html>
<html>
<head>
    <meta charset="utf-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>工单处理</title>
    <meta name="keywords" content="">
    <meta name="description" content="">
    <include file="Index/common_css"/>
    <link href="__PUBLIC__/admin/css/plugins/iCheck/custom.css" rel="stylesheet">
    <link href="__PUBLIC__/common/css/dataTables.bootstrap.css" rel="stylesheet">
    <!--分页样式-->
    <style type="text/css">
        div.green-black{padding:3px;margin:3px;text-align:center;}
        div.green-black a{border:#2c2c2c 1px solid;padding:2px 5px;background:#2c2c2c;color:#fff;margin:0 2px 0 0;text-decoration:none;}
        div.green-black a:hover{border: #23b7e5 1px solid;background: #23b7e5;color:#fff;}
        div.green-black a:active{border: #23b7e5 1px solid;background: #23b7e5;color:#fff;}
        div.green-black span.current{border: #23b7e5 1px solid;padding:2px 5px;font-weight:bold;background:#23b7e5;color:#fff;margin:0 2px 0 0;}
        div.green-black span.disabled{border:#f3f3f3 1px solid;padding:2px 5px;color:#ccc;margin:0 2px 0 0;}
    </style>
</head>

<body class="gray-bg">
<div class="wrapper wrapper-content animated fadeInUp">
    <div class="row">
        <div class="col-sm-12">

            <div class="ibox">
                <div class="ibox-title">
                    <h5>工单 列表</h5>

                </div>

                <div class="ibox-content">
                    <div class="row m-b-sm m-t-sm">
                        <div class="col-md-1">
                            <button type="button" id="loading-example-btn" class="btn btn-white btn-sm"><i class="fa fa-refresh"></i> 刷新</button>
                        </div>
                        <div class="row">
                            <form action="__MODULE__/Apply/work_order" method="post">
                                <div class="col-sm-2 m-b-xs">
                                    <select name="status" class="input-sm form-control input-s-sm inline">
                                        <option value="0">全部</option>
                                        <option value="1" <if condition="$status eq 1">selected="selected"</if>>等待处理</option>
                                        <option value="2" <if condition="$status eq 2">selected="selected"</if>>处理中</option>
                                        <option value="3" <if condition="$status eq 3">selected="selected"</if>>已完成</option>
                                    </select>
                                </div>

                                <div class="col-sm-4 m-b-xs">
                                    时间 ： <input type="text" placeholder="开始时间" id="from" name="fo" value="{$fo}" class="laydate-icon form-control layer-date" style="width:40%;display:inline-block;"> -
                                    <input type="text" id="to" name="to" placeholder="结束时间" value="{$to}" class="laydate-icon form-control layer-date" style="width:40%;display:inline-block;">
                                </div>
                                <div class="col-sm-3">
                                    <div class="input-group">
                                        <input type="text" name="mt4" value="{$mt4}" style="width:200px;" placeholder="输入MT4账号查询" class="input-sm form-control">
                                        <span class="input-group-btn">
                                    <button type="submit" class="btn btn-w-m btn-info">搜索</button>
                                </span>
                                    </div>
                                </div>
                            </form>
                        </div>

                    </div>

                    <div class="project-list">

                        <table class="table table-hover">
                            <thead>
                            <tr>
                                <th>状态</th>
                                <th>账号</th>
                                <th>工单类型</th>
                                <th>工单标题</th>
                                <th>进度</th>
                                <!--<th>缩略图</th>-->
                                <th>操作</th>
                            </tr>
                            </thead>
                            <tbody>
                            <foreach name="list" item="li">
                                <tr>
                                    <td class="project-status">
                                        <if condition="($li.state eq 1) or($li.state eq 4)">
                                            <span class="label label-default">{$li.sys_state}</span>
                                           <elseif condition="$li.state eq 3 "/>
                                            <span class="label label-success">{$li.sys_state}</span>
                                            <else/>
                                            <span class="label label-primary">{$li.sys_state}</span>
                                        </if>
                                    </td>
                                    <td class="project-status">
                                        <span>{$li.user_id}</span>
                                    </td>

                                    <td class="project-status">
                                        <span class="label">{$li.type}</span>
                                    </td>

                                    <td class="project-title">
                                        <a href="javascript:;">{$li.title}</a>
                                        <br/>
                                        <small>创建于 {$li.time}</small>
                                    </td>
                                    <td class="project-completion">
                                        <small>当前进度：{$li.speed}</small>
                                        <div class="progress progress-mini">
                                            <div style="width: {$li.speed};" class="progress-bar"></div>
                                        </div>
                                    </td>
                                    <!--<td class="project-people" >-->
                                        <!--&lt;!&ndash;project-people&ndash;&gt;-->
                                        <!--<if condition="$li['file'] neq 'Uploads/'">-->
                                            <!--<a href="javascript:;"><img alt="image" class="img-circle" src="__ROOT__/{$li.file}"></a>-->
                                        <!--</if>-->
                                        <!--<if condition="$li['file2'] neq 'Uploads/'">-->
                                            <!--<a href="javascript:;"><img alt="image" class="img-circle" src="__ROOT__/{$li.file2}"></a>-->
                                        <!--</if>-->
                                        <!--<if condition="$li['file3'] neq 'Uploads/'">-->
                                            <!--<a href="javascript:;"><img alt="image" class="img-circle" src="__ROOT__/{$li.file3}"></a>-->
                                        <!--</if>-->
                                    <!--</td>-->
                                    <td class="project-actions">
                                        <if condition="$li.state eq 4">
                                            <else/>
                                            <a href="__MODULE__/Apply/work_order_detail/id/{$li.id}" class="btn btn-white btn-sm"><i class="fa fa-search-plus"></i> 查看 </a>
                                        </if>
                                    </td>
                                </tr>
                            </foreach>
                            </tbody>
                        </table>
                        <div class="green-black">{$page}</div>
                    </div>
                </div>
            </div>
        </div>
    </div>
</div>
<!-- 全局js -->
<include file="Index/common_js"/>
<!-- Peity -->
<!--<script src="__PUBLIC__/admin/js/plugins/peity/jquery.peity.min.js"></script>-->
<!-- 自定义js -->
<script src="__PUBLIC__/admin/js/content.js?v=1.0.0"></script>
<script src="__PUBLIC__/admin/js/plugins/layer/laydate/laydate.js"></script>
<script src="__PUBLIC__/admin/js/plugins/validate/messages_zh.min.js"></script>
<script src="__PUBLIC__/admin/js/plugins/iCheck/icheck.min.js"></script>
<script>
    $(document).ready(function(){
        $('#loading-example-btn').click(function () {
            btn = $(this);
            simpleLoad(btn, true)
            simpleLoad(btn, false)
        });
    });

    $(document).ready(function () {
        $('.i-checks').iCheck({
            checkboxClass: 'icheckbox_square-green',
            radioClass: 'iradio_square-green',
        });

        laydate({
            elem: '#from', /*目标元素。由于laydate.js封装了一个轻量级的选择器引擎，因此elem还允许你传入class、tag但必须按照这种方式 '#id .class'*/
            event: 'focus', /*响应事件。如果没有传入event，则按照默认的click*/
            //format: 'YYYY-MM-DD hh:mm:ss',
        });
        laydate({
            elem: '#to', /*目标元素。由于laydate.js封装了一个轻量级的选择器引擎，因此elem还允许你传入class、tag但必须按照这种方式 '#id .class'*/
            event: 'focus' /*响应事件。如果没有传入event，则按照默认的click*/
        });
    });

    function simpleLoad(btn, state) {
        if (state) {
            btn.children().addClass('fa-spin');
            btn.contents().last().replaceWith(" Loading");
        } else {
            setTimeout(function () {
                btn.children().removeClass('fa-spin');
                btn.contents().last().replaceWith(" Refresh");
                location.reload();
            }, 2000);
        }
    }
</script>
</body>
</html>
